package com.andy.nicefi.manager;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.andy.nicefi.bean.User;
import com.andy.nicefi.dao.UserDAO;

@Repository
public class UserManager extends BaseManager{
	
	private static final Logger log = LoggerFactory.getLogger(UserManager.class);
	
	@Autowired
	private UserDAO userDAO;
	
	public void save(User instance) throws Exception{
		this.userDAO.save(instance);
	}
	
	public void delete(User instance){
		this.userDAO.delete(instance);
	}
	
	public void delete(String id){
		this.userDAO.delete(id);
	}
	
	public List<User> getUserList(){
		return this.userDAO.list();
	}
	
	public boolean exist(String hql){
		return this.userDAO.exist(hql);
	}
	
	public void update(User instance){
		this.userDAO.update(instance);
	}
	
	public User getUser(String hql){
		return this.userDAO.getValue(hql);
	}

	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

}
